package edu.unlv.cs.ladders.notification;

import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.stereotype.Service;

import edu.unlv.cs.ladders.entities.Event;
import edu.unlv.cs.ladders.entities.Team;

@RooJavaBean
@Service
public class NotificationServiceImpl implements NotificationService {
	private Notification eventChanged;
	private Notification newEvent;
	private Notification newMember;
	
	public void notifyTeamMembersEventChanged(Event event) {
		Team challenger = event.getChallenger();
		Team defender = event.getDefender();
		getEventChanged().notifyTeams(challenger,defender);
	}

	public void notifyTeamMembersOfNewMember(Team team) {
		getNewMember().notifyTeams(team);
	}

	public void notifyTeamMembersOfNewEvent(Event event) {
		Team challenger = event.getChallenger();
		Team defender = event.getDefender();
		getNewEvent().notifyTeams(challenger,defender);
	}
	public void setEventChanged(Notification eventChanged){
		this.eventChanged = eventChanged;
	}
	public void setNewEvent(Notification newEvent){
		this.newEvent = newEvent;
	}
	public void setNewMember(Notification newMember){
		this.newMember = newMember;
	}
}
